package com.zkh.myframe.database.mapper;

import java.io.ByteArrayInputStream;
import java.io.IOException;

import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

/**
 * 解析xml文件时忽略DTD校验
 * @author zkh
 */
public class IgnoreDTDEntityResolver implements EntityResolver {
	/**
	 * 重写实现方法
	 */
	public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
		return new InputSource(new ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8'?>".getBytes()));
	}
}
